<script type="text/javascript" src="${rc.contextPath}/resources/scripts/entity/User.js"></script>

<#assign entityAdd>
	<@spring.message "entity.add" />
</#assign>
<#assign labelFirstPage>
	<@spring.message "firstPage" />
</#assign>
<#assign labelPreviousPage>
	<@spring.message "previousPage" />
</#assign>
<#assign messageParameters = ["<b id=\"user-list-pagination-from\"></b>", "<b id=\"user-list-pagination-to\"></b>"] />
<#assign labelCounterPage>
	<@spring.messageArgs "counterPage" messageParameters />
</#assign>
<#assign labelNextPage>
	<@spring.message "nextPage" />
</#assign>
<#assign labelLastPage>
	<@spring.message "lastPage" />
</#assign>

<div id="content-user-list" class="list" style="display: none;">
	<h2><@spring.message "user.list" /></h2>
	
	<div id="user-list-error" style="display: none;">
	</div>
	
	<table>
		<thead>
			<tr>
				<th style="text-align: left;"><@spring.message "user.field.userName" /></th>
				<th>&nbsp;</th>
				<th>&nbsp;</th>
			</tr>
		</thead>
		<tbody id="user-list-body">
		</tbody>
		<tbody>
			<tr>
				<td colspan="3">
					<a id="user-edit-0" href="#" alt="${entityAdd}" title="${entityAdd}"><img class="image" src="${rc.contextPath}/resources/images/add.png" /></a>
					<span id="user-list-pagination" style="display: none;">
						<span>|</span>
						<a id="user-list-pagination-first" href="#" alt="${labelFirstPage}" title="${labelFirstPage}"><img class="image" src="${rc.contextPath}/resources/images/resultset_first.png" /></a>
						<a id="user-list-pagination-previous" href="#" alt="${labelPreviousPage}" title="${labelPreviousPage}"><img class="image" src="${rc.contextPath}/resources/images/resultset_previous.png" /></a>
						<span>${labelCounterPage}</span>
						<a id="user-list-pagination-next" href="#" alt="${labelNextPage}" title="${labelNextPage}"><img class="image" src="${rc.contextPath}/resources/images/resultset_next.png" /></a>
						<a id="user-list-pagination-last" href="#" alt="${labelLastPage}" title="${labelLastPage}"><img class="image" src="${rc.contextPath}/resources/images/resultset_last.png" /></a>
					</span>
				</td>
			</tr>
		</tbody>
	</table>
</div>
<div id="content-user-edit" class="edit" style="display: none;">
	<h2><@spring.message "user.edit" /></h2>
	
	<div id="user-edit-error" style="display: none;">
	</div>
	
	<form id="user-edit-form">
		<input type="hidden" id="form-user-id" name="id" />
		<table>
			<tr>
				<td class="first">
					<label for="form-user-userName"><@spring.message "user.field.userName" />:<em>*</em></label>
				</td>
				<td class="secondSingle" colspan="3">
					<input type="text" id="form-user-userName" name="userName" maxlength="10" />
				</td>
			</tr>
			<tr>
				<td class="first">
					<label for="form-user-password"><@spring.message "user.field.password" />:<em id="form-user-password-required">*</em></label>
				</td>
				<td class="secondSingle" colspan="3">
					<input type="password" id="form-user-password" name="password" maxlength="8" />
				</td>
			</tr>
			<tr>
				<td class="first">
					<label for="form-user-authorities"><@spring.message "user.field.authorities" />:<em>*</em></label>
				</td>
				<td class="secondSingle" colspan="3">
					<select id="form-user-authorities" name="authorities" size="3" multiple="multiple">
					</select>
				</td>
			</tr>
		</table>
	</form>
	<p>
		<a id="user-edit-save" href="#" alt="Salvar" title="Salvar">[Salvar]</a>&nbsp;|&nbsp;<a id="user-edit-back" href="#" alt="Voltar" title="Voltar">[Voltar]</a>
	</p>
</div>

<script type="text/javascript">
	function init() {
		new User().init();
	}
	
	this.init();
</script>
